package vn.easyticket.db.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * The primary key class for the E101_MOVIECATEGORY database table.
 */
@Embeddable
public class E101_Movie_CategoryPK
    implements Serializable

{
    private static final long serialVersionUID = -7664422159008309929L;

    @Column( name = "MovieId", unique = true, nullable = false )
    private int movieId;

    @Column( name = "CategoryId", unique = true, nullable = false )
    private int categoryId;

    public E101_Movie_CategoryPK()
    {
    }

    public int getMovieId()
    {
        return this.movieId;
    }

    public void setMovieId( int movieId )
    {
        this.movieId = movieId;
    }

    public int getCategoryId()
    {
        return this.categoryId;
    }

    public void setCategoryId( int categoryId )
    {
        this.categoryId = categoryId;
    }

    public boolean equals( Object other )
    {
        if ( this == other )
        {
            return true;
        }
        if ( !( other instanceof E101_Movie_CategoryPK ) )
        {
            return false;
        }
        E101_Movie_CategoryPK castOther = (E101_Movie_CategoryPK) other;
        return ( this.movieId == castOther.movieId ) && ( this.categoryId == castOther.categoryId );
    }

    public int hashCode()
    {
        final int prime = 31;
        int hash = 17;
        hash = hash * prime + this.movieId;
        hash = hash * prime + this.categoryId;

        return hash;
    }
}